<?php
namespace Admin\Controller;
use Think\Controller;
class LoginController extends Controller {

	public function login(){
		$username = I('post.username');
		$password = md5(I('post.password'));
		if($_POST){
			$model = M("user");
			$res = $model->where("username = '{$username}'")->select();
			$userInfo = $res[0];
			session('admin.userInfo',$userInfo);
			$this->redirect('user/index');
			return ;
		}
		$this->assign('title','后台登录');
		$this->display();
	}
}